/**
* Copyright (C) 2018-2020
* All rights reserved, Designed By www.yixiang.co
* 注意：
* 本软件为www.yixiang.co开发研制，未经购买不得使用
* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
* 一经发现盗用、分享等行为，将追究法律责任，后果自负
*/
package co.yixiang.modules.rotaryTableRecord.service.mapper;

import co.yixiang.common.mapper.CoreMapper;
import co.yixiang.modules.rotaryTableRecord.domain.RotaryTableRecord;
import co.yixiang.modules.rotaryTableRecord.service.dto.RotaryTableRecordQueryCriteria;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author hupeng
* @date 2020-12-23
*/
@Repository
public interface RotaryTableRecordMapper extends CoreMapper<RotaryTableRecord> {

    @Select("select * from yx_rotary_table_record where uid =#{uid} ")
    Page<RotaryTableRecord> rotaryPage(@Param("page") Page page1,@Param("uid") Long uid);

    @Select("<script> SELECT yrtr.* , ya.real_name as userName , yu.phone as phone " +
            "from yx_rotary_table_record yrtr , " +
            "yx_user yu , yx_authentication ya where yrtr.uid = ya.uid and yrtr.uid = yu.uid " +
            "<if test=\"userName !=null and userName !='' \"> and ya.real_name like concat('%',#{userName},'%') </if>" +
            "<if test=\"phone !=null and phone !='' \"> and yu.phone like concat('%',#{phone},'%') </if>" +
            "</script>")
    List<RotaryTableRecord> selectRotaryList(RotaryTableRecordQueryCriteria criteria);
}
